Closed
Conversation
There was a problem hiding this comment.
Pull request overview
Adds RIOT CSV export functionality to the glide pipeline, allowing L2 processing to optionally output a $riotData-style CSV file with ping data and interpolated positions.
Changes:
- New
riot_csv_writer.pymodule that converts an xarray Dataset into a RIOT-compatible CSV format with optional position interpolation - New CLI options
--riot-csvand--riot-positionson thel2command to trigger RIOT CSV output .gitignoreupdate for PyCharm project files
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/glide/riot_csv_writer.py | New module implementing RIOT CSV export with position interpolation |
| src/glide/cli.py | Adds --riot-csv and --riot-positions CLI options to l2 command |
| .gitignore | Adds PyCharm .idea ignore pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| # Write to CSV | ||
| _log.debug("Writing to RIOT CSV") | ||
| riot_df.to_csv( | ||
| output_path, index=False, header=False, lineterminator="\n", mode="a" |
| "slot": slot, | ||
| "group": group, | ||
| "state": platform_state, | ||
| "num_records": np.full(len(epoch_msecs), np.nan), |
Comment on lines
+60
to
+68
| position_vars = ["depth", "lat", "lon", "time"] | ||
|
|
||
| # Check that all required RIOT variables are present in the dataset | ||
| if not set(riot_vars).issubset(set(ds.data_vars)): | ||
| _log.error("Dataset is missing required RIOT variables") | ||
| return | ||
|
|
||
| # Optionally add position variables if they are present in the dataset | ||
| if add_positions and not set(position_vars).issubset(ds.variables): |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
Superceded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.